//
//  UIFactory.h
//  zxcrm
//
//  Created by 刘佳乐 on 2020/5/15.
//  Copyright © 2020 user. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIFactory : NSObject

@property(nonatomic,assign)BOOL isRed;
/// UI工厂单例
+(UIFactory*)shareInstace;



-(UIButton*)setButton:(UIButtonType)type frame:(CGRect)frame image:(nullable UIImage *)image title:(NSString*)title font:(nullable UIFont*)font backColot:(UIColor*)backColor textColor:(UIColor*)textColor target:(nullable id)target action:(SEL)action layer:(float)layer;

-(UILabel*)setLabel:(CGRect)frame text:(NSString *)text font:(UIFont *)font textColor:(UIColor*)textColor;

-(CGSize)getStrRect:(UIFont*)font str:(NSString*)str height:(double)height width:(double)width;

-(UIView*)setLineView:(CGRect)frame color:(UIColor*)color;

-(NSString *) deleteStr:(NSString*)str repalcesStr:(NSString *)repalcesStr repalcesStr1:(NSString *)repalcesStr1;

-(NSMutableAttributedString*)setPlaceHolder:(UIFont*)font color:(UIColor *)color placeHolder:(NSString *)placeHolder;

- (UIViewController *)viewController:(UIView*)view;

- (UIViewController *)getCurrentVC;

//添加渐变色
- (void)addTransitionColor:(UIColor *)startColor endColor:(UIColor *)endColor view:(UIView *)view;
- (void)addTransitionColorLeftToRight:(UIColor *)startColor endColor:(UIColor *)endColor view:(UIView *)view;
- (void)addTransitionColor:(UIColor *)startColor
                  endColor:(UIColor *)endColor
                startPoint:(CGPoint)startPoint
                  endPoint:(CGPoint)endPoint view:(UIView *)view;

-(void)showAlert:(NSString*)confirmStr cancelStr:(NSString*)cancelStr title:(NSString*)title message:(NSString*)message viewController:(UIViewController *)viewController
          confirmAction:(void (^ __nullable)(UIAlertAction *action))confirmAction cancelAction:(void (^ __nullable)(UIAlertAction *action))cancelAction;

@end

NS_ASSUME_NONNULL_END
